import ownApi from "@/api/ownApi.js";


let filter = async () => {
	let token = uni.getStorageSync('token');
	if (token == null || token == "" || token == undefined) {
		uni.redirectTo({
			url: "/pages/own/login"
		});
	} else {
		let res = await ownApi.getUserInfo();
		if (res.code == 0) {
			let userInfo = res.data;
			uni.setStorageSync("info",userInfo);
		} else {
			uni.redirectTo({
				url: "/pages/own/login"
			});
		}
	}

}

export default filter;